Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Gillespie algorithm</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Gillespie_algorithm"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Gillespie_algorithm rootpage-Gillespie_algorithm skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Gillespie algorithm</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>In <a href="Probability_theory" title="Probability theory">probability theory</a>, the <b>Gillespie algorithm</b> (or the <b>Doob–Gillespie algorithm</b> or <b>stochastic simulation algorithm</b>, the <b>SSA</b>) generates a statistically correct trajectory (possible solution) of a <a href="Stochastic" title="Stochastic">stochastic</a> equation system for which the <a href="Reaction_rates" class="mw-redirect" title="Reaction rates">reaction rates</a> are known. It was created by <a href="Joseph_L._Doob" title="Joseph L. Doob">Joseph L. Doob</a> and others (circa 1945), presented by <a href="Dan_Gillespie" class="mw-redirect" title="Dan Gillespie">Dan Gillespie</a> in 1976, and popularized in 1977 in a paper where he uses it to simulate chemical or biochemical systems of reactions efficiently and accurately using limited computational power (see <a href="Stochastic_simulation" title="Stochastic simulation">stochastic simulation</a>).<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> As computers have become faster, the algorithm has been used to simulate increasingly complex systems. The algorithm is particularly useful for simulating reactions within cells, where the number of <a href="Reagent" title="Reagent">reagents</a> is low and keeping track of every single reaction is computationally feasible. Mathematically, it is a variant of a <a href="Dynamic_Monte_Carlo_method" title="Dynamic Monte Carlo method">dynamic Monte Carlo method</a> and similar to the <a href="Kinetic_Monte_Carlo" title="Kinetic Monte Carlo">kinetic Monte Carlo</a> methods. It is used heavily in <a href="Computational_systems_biology" class="mw-redirect" title="Computational systems biology">computational systems biology</a>.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="History">History</h2></div>
<p>The process that led to the algorithm recognizes several important steps. In 1931, <a href="Andrei_Kolmogorov" class="mw-redirect" title="Andrei Kolmogorov">Andrei Kolmogorov</a> introduced the differential equations corresponding to the time-evolution of stochastic processes that proceed by jumps, today known as <a href="Kolmogorov_equations_(Markov_jump_process)" class="mw-redirect" title="Kolmogorov equations (Markov jump process)">Kolmogorov equations (Markov jump process)</a> (a simplified version is known as <a href="Master_equation" title="Master equation">master equation</a> in the natural sciences). It was <a href="William_Feller" title="William Feller">William Feller</a>, in 1940, who found the conditions under which the Kolmogorov equations admitted (proper) probabilities as solutions. In his Theorem I (1940 work) he establishes that the time-to-the-next-jump was exponentially distributed and the probability of the next event is proportional to the rate. As such, he established the relation of Kolmogorov's equations with <a href="Stochastic_process" title="Stochastic process">stochastic processes</a>.
Later, Doob (1942, 1945) extended Feller's solutions beyond the case of pure-jump processes. The method was implemented in computers by <a href="David_George_Kendall" title="David George Kendall">David George Kendall</a> (1950) using the <a href="Manchester_Mark_1" title="Manchester Mark 1">Manchester Mark 1</a> computer and later used by <a href="Maurice_S._Bartlett" class="mw-redirect" title="Maurice S. Bartlett">Maurice S. Bartlett</a> (1953) in his studies of epidemics outbreaks. Gillespie (1977) obtains the algorithm in a different manner by making use of a physical argument.
</p>
<div class="mw-heading mw-heading2"><h2 id="Idea">Idea</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Mathematics">Mathematics</h3></div>
<p>In a reaction chamber, there are a finite number of molecules. At each infinitesimal slice of time, a single reaction might take place. The rate is determined by the number of molecules in each chemical species.
</p><p>Naively, we can simulate the trajectory of the reaction chamber by discretizing time, then simulate each time-step. However, there might be long stretches of time where no reaction occurs. The Gillespie algorithm samples a random waiting time until <i>some</i> reaction occurs, then take another random sample to decide <i>which</i> reaction has occurred.
</p><p>The key assumptions are that
</p>
<ul><li>each reaction is Markovian in time</li>
<li>there are no correlations between reactions</li></ul>
<p>Given the two assumptions, the random waiting time for <i>some</i> reaction is exponentially distributed, with exponential rate being the sum of the individual reaction's rates.
</p>
<div class="mw-heading mw-heading3"><h3 id="Validity_in_biochemical_simulations">Validity in biochemical simulations</h3></div>
<p>Traditional continuous and deterministic biochemical <a href="Rate_equation" title="Rate equation">rate equations</a> do not accurately predict cellular reactions since they rely on bulk reactions that require the interactions of millions of molecules. They are typically modeled as a set of coupled ordinary differential equations. In contrast, the Gillespie algorithm allows a discrete and stochastic simulation of a system with few reactants because every reaction is explicitly simulated. A trajectory corresponding to a single Gillespie simulation represents an exact sample from the probability mass function that is the solution of the <a href="Master_equation" title="Master equation">master equation</a>.
</p><p>The physical basis of the algorithm is the collision of molecules within a reaction vessel. It is assumed that collisions are frequent, but collisions with the proper orientation and energy are infrequent. It is assumed that the reaction environment is well mixed.
</p>
<div class="mw-heading mw-heading2"><h2 id="Algorithm">Algorithm</h2></div>
<p>A review (Gillespie, 2007) outlines three different, but equivalent formulations; the direct, first-reaction, and first-family methods, whereby the former two are special cases of the latter. The formulation of the direct and first-reaction methods is centered on performing the usual Monte Carlo inversion steps on the so-called "fundamental premise of stochastic chemical kinetics", which mathematically is the function
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle p(\tau ,j\mid {\boldsymbol {x}},t)=a_{j}({\boldsymbol {x}})\exp \left(-\tau \sum _{j}a_{j}({\boldsymbol {x}})\right),}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>p</mi>
<mo stretchy="false">(</mo>
<mi>τ<!-- τ --></mi>
<mo>,</mo>
<mi>j</mi>
<mo>∣<!-- ∣ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo>,</mo>
<mi>t</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo stretchy="false">)</mo>
<mi>exp</mi>
<mo>⁡<!-- ⁡ --></mo>
<mrow>
<mo>(</mo>
<mrow>
<mo>−<!-- − --></mo>
<mi>τ<!-- τ --></mi>
<munder>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</munder>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo stretchy="false">)</mo>
</mrow>
<mo>)</mo>
</mrow>
<mo>,</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle p(\tau ,j\mid {\boldsymbol {x}},t)=a_{j}({\boldsymbol {x}})\exp \left(-\tau \sum _{j}a_{j}({\boldsymbol {x}})\right),}</annotation>
</semantics>
</math></span><img src="./1b15db1778f31b9f6bcce59e06f9b6a23ac41f0c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.338ex; margin-left: -0.089ex; width:41.071ex; height:7.676ex;" alt="{\displaystyle p(\tau ,j\mid {\boldsymbol {x}},t)=a_{j}({\boldsymbol {x}})\exp \left(-\tau \sum _{j}a_{j}({\boldsymbol {x}})\right),}" loading="lazy"></span></dd></dl>
<p>where each of the <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>a</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle a}</annotation>
</semantics>
</math></span><img src="./ffd2487510aa438433a2579450ab2b3d557e5edc.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.23ex; height:1.676ex;" alt="{\displaystyle a}" loading="lazy"></span> terms are propensity functions of an elementary reaction, whose argument is <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\boldsymbol {x}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\boldsymbol {x}}}</annotation>
</semantics>
</math></span><img src="./606b7680d510560a505937143775ea80fa958051.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.532ex; height:1.676ex;" alt="{\displaystyle {\boldsymbol {x}}}" loading="lazy"></span>, the vector of species counts. The <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \tau }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>τ<!-- τ --></mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \tau }</annotation>
</semantics>
</math></span><img src="./38a7dcde9730ef0853809fefc18d88771f95206c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.202ex; height:1.676ex;" alt="{\displaystyle \tau }" loading="lazy"></span> parameter is the time to the next reaction (or sojourn time), and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle t}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>t</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle t}</annotation>
</semantics>
</math></span><img src="./65658b7b223af9e1acc877d848888ecdb4466560.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.84ex; height:2.009ex;" alt="{\displaystyle t}" loading="lazy"></span> is the current time. To paraphrase Gillespie, this expression is read as "the probability, given <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\boldsymbol {X}}(t)={\boldsymbol {x}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">X</mi>
</mrow>
<mo stretchy="false">(</mo>
<mi>t</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\boldsymbol {X}}(t)={\boldsymbol {x}}}</annotation>
</semantics>
</math></span><img src="./358c89dd5a6cd8739042f2070ba166d14e7ff818.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:9.494ex; height:2.843ex;" alt="{\displaystyle {\boldsymbol {X}}(t)={\boldsymbol {x}}}" loading="lazy"></span>, that the system's next reaction will occur in the infinitesimal time interval <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle [t+\tau ,t+\tau +d\tau ]}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">[</mo>
<mi>t</mi>
<mo>+</mo>
<mi>τ<!-- τ --></mi>
<mo>,</mo>
<mi>t</mi>
<mo>+</mo>
<mi>τ<!-- τ --></mi>
<mo>+</mo>
<mi>d</mi>
<mi>τ<!-- τ --></mi>
<mo stretchy="false">]</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle [t+\tau ,t+\tau +d\tau ]}</annotation>
</semantics>
</math></span><img src="./15345f55272f734879a3eae51fd2dd507ef778ab.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:17.35ex; height:2.843ex;" alt="{\displaystyle [t+\tau ,t+\tau +d\tau ]}" loading="lazy"></span>, and will be of stoichiometry corresponding to the <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle j}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>j</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle j}</annotation>
</semantics>
</math></span><img src="./2f461e54f5c093e92a55547b9764291390f0b5d0.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.027ex; width:0.985ex; height:2.509ex;" alt="{\displaystyle j}" loading="lazy"></span>th reaction". This formulation provides a window to the direct and first-reaction methods by implying <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \tau }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>τ<!-- τ --></mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \tau }</annotation>
</semantics>
</math></span><img src="./38a7dcde9730ef0853809fefc18d88771f95206c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.202ex; height:1.676ex;" alt="{\displaystyle \tau }" loading="lazy"></span> is an exponentially-distributed random variable, and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle j}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>j</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle j}</annotation>
</semantics>
</math></span><img src="./2f461e54f5c093e92a55547b9764291390f0b5d0.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.027ex; width:0.985ex; height:2.509ex;" alt="{\displaystyle j}" loading="lazy"></span> is "a statistically independent integer random variable with point probabilities <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a_{j}({\boldsymbol {x}})/\sum _{j}a_{j}({\boldsymbol {x}})}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<munder>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</munder>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle a_{j}({\boldsymbol {x}})/\sum _{j}a_{j}({\boldsymbol {x}})}</annotation>
</semantics>
</math></span><img src="./579aa0fe8767689ffa8f98ff9607ae1d14f44a77.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.338ex; width:16.253ex; height:5.843ex;" alt="{\displaystyle a_{j}({\boldsymbol {x}})/\sum _{j}a_{j}({\boldsymbol {x}})}" loading="lazy"></span>".
</p><p>Thus, the Monte Carlo generating method is simply to draw two pseudorandom numbers, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle r_{1}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>r</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle r_{1}}</annotation>
</semantics>
</math></span><img src="./ea214f2b31fb3869344bb9311da41c5cc38a99e1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.103ex; height:2.009ex;" alt="{\displaystyle r_{1}}" loading="lazy"></span> and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle r_{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>r</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle r_{2}}</annotation>
</semantics>
</math></span><img src="./4cbe9b0b294fdd6fadbf9a7249813f016dcbc44f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.103ex; height:2.009ex;" alt="{\displaystyle r_{2}}" loading="lazy"></span> on <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle [0,1]}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">[</mo>
<mn>0</mn>
<mo>,</mo>
<mn>1</mn>
<mo stretchy="false">]</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle [0,1]}</annotation>
</semantics>
</math></span><img src="./738f7d23bb2d9642bab520020873cccbef49768d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.653ex; height:2.843ex;" alt="{\displaystyle [0,1]}" loading="lazy"></span>, and compute
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \tau ={\frac {1}{\sum _{j}a_{j}({\boldsymbol {x}})}}\log \left({\frac {1}{r_{1}}}\right),}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>τ<!-- τ --></mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mn>1</mn>
<mrow>
<munder>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</munder>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo stretchy="false">)</mo>
</mrow>
</mfrac>
</mrow>
<mi>log</mi>
<mo>⁡<!-- ⁡ --></mo>
<mrow>
<mo>(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mn>1</mn>
<msub>
<mi>r</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
</mfrac>
</mrow>
<mo>)</mo>
</mrow>
<mo>,</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \tau ={\frac {1}{\sum _{j}a_{j}({\boldsymbol {x}})}}\log \left({\frac {1}{r_{1}}}\right),}</annotation>
</semantics>
</math></span><img src="./c206dbcad71b6b162435d61146f241755ae5a66b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:24.734ex; height:6.676ex;" alt="{\displaystyle \tau ={\frac {1}{\sum _{j}a_{j}({\boldsymbol {x}})}}\log \left({\frac {1}{r_{1}}}\right),}" loading="lazy"></span></dd></dl>
<p>and
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle j={}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>j</mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">

</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle j={}}</annotation>
</semantics>
</math></span><img src="./8f4d356508a8d7bb3858415cf795e49a53dd25a6.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.027ex; width:4.083ex; height:2.509ex;" alt="{\displaystyle j={}}" loading="lazy"></span>the smallest integer satisfying <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \sum _{j'=1}^{j}a_{j'}({\boldsymbol {x}})>r_{2}\sum _{j}a_{j}({\boldsymbol {x}}).}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<msup>
<mi>j</mi>
<mo>′</mo>
</msup>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</munderover>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<msup>
<mi>j</mi>
<mo>′</mo>
</msup>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo>&gt;</mo>
<msub>
<mi>r</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
<munder>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</munder>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \sum _{j'=1}^{j}a_{j'}({\boldsymbol {x}})&gt;r_{2}\sum _{j}a_{j}({\boldsymbol {x}}).}</annotation>
</semantics>
</math></span><img src="./c0f7b31d3cde8ae92e2ce6ebb03d9c33cf93a436.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.671ex; width:25.212ex; height:8.009ex;" alt="{\displaystyle \sum _{j'=1}^{j}a_{j'}({\boldsymbol {x}})>r_{2}\sum _{j}a_{j}({\boldsymbol {x}}).}" loading="lazy"></span></dd></dl>
<p>Utilizing this generating method for the sojourn time and next reaction, the direct method algorithm is stated by Gillespie as
</p>
<pre>1. Initialize the time <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle t=t_{0}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>t</mi>
<mo>=</mo>
<msub>
<mi>t</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle t=t_{0}}</annotation>
</semantics>
</math></span><img src="./be6d7492e2d48bf34fdd5dffa189b188c140820c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:5.832ex; height:2.343ex;" alt="{\displaystyle t=t_{0}}" loading="lazy"></span> and the system's state <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\boldsymbol {x}}={\boldsymbol {x}}_{0}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo>=</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\boldsymbol {x}}={\boldsymbol {x}}_{0}}</annotation>
</semantics>
</math></span><img src="./f2e0d2c021ba81923b29f5366e9b86ec9ca981b4.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:7.216ex; height:2.009ex;" alt="{\displaystyle {\boldsymbol {x}}={\boldsymbol {x}}_{0}}" loading="lazy"></span>
2. With the system in state <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\boldsymbol {x}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\boldsymbol {x}}}</annotation>
</semantics>
</math></span><img src="./606b7680d510560a505937143775ea80fa958051.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.532ex; height:1.676ex;" alt="{\displaystyle {\boldsymbol {x}}}" loading="lazy"></span> at time <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle t}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>t</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle t}</annotation>
</semantics>
</math></span><img src="./65658b7b223af9e1acc877d848888ecdb4466560.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.84ex; height:2.009ex;" alt="{\displaystyle t}" loading="lazy"></span>, evaluate all the <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a_{j}({\boldsymbol {x}})}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle a_{j}({\boldsymbol {x}})}</annotation>
</semantics>
</math></span><img src="./8c029a7595384c651ace749f6638e6fd5547628f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:5.481ex; height:3.009ex;" alt="{\displaystyle a_{j}({\boldsymbol {x}})}" loading="lazy"></span> and their sum <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \sum _{j}a_{j}({\boldsymbol {x}})}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<munder>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</munder>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \sum _{j}a_{j}({\boldsymbol {x}})}</annotation>
</semantics>
</math></span><img src="./8e4dd97352c34cd1ee0a684ecd05be292796e49b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.338ex; width:9.223ex; height:5.843ex;" alt="{\displaystyle \sum _{j}a_{j}({\boldsymbol {x}})}" loading="lazy"></span>
3. Calculate the above value of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \tau }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>τ<!-- τ --></mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \tau }</annotation>
</semantics>
</math></span><img src="./38a7dcde9730ef0853809fefc18d88771f95206c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.202ex; height:1.676ex;" alt="{\displaystyle \tau }" loading="lazy"></span> and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle j}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>j</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle j}</annotation>
</semantics>
</math></span><img src="./2f461e54f5c093e92a55547b9764291390f0b5d0.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.027ex; width:0.985ex; height:2.509ex;" alt="{\displaystyle j}" loading="lazy"></span>
4. Effect the next reaction by replacing <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle t\leftarrow t+\tau }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>t</mi>
<mo stretchy="false">←<!-- ← --></mo>
<mi>t</mi>
<mo>+</mo>
<mi>τ<!-- τ --></mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle t\leftarrow t+\tau }</annotation>
</semantics>
</math></span><img src="./9443cfee6aeef0bcd01af272e399ed66193c1080.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:9.336ex; height:2.176ex;" alt="{\displaystyle t\leftarrow t+\tau }" loading="lazy"></span> and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\boldsymbol {x}}\leftarrow {\boldsymbol {x}}+\nu _{j}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo stretchy="false">←<!-- ← --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo>+</mo>
<msub>
<mi>ν<!-- ν --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\boldsymbol {x}}\leftarrow {\boldsymbol {x}}+\nu _{j}}</annotation>
</semantics>
</math></span><img src="./551be26aa7705a01a967fd5d31034a649f1a0025.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:11.576ex; height:2.676ex;" alt="{\displaystyle {\boldsymbol {x}}\leftarrow {\boldsymbol {x}}+\nu _{j}}" loading="lazy"></span>
5. Record <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle ({\boldsymbol {x}},t)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">x</mi>
</mrow>
<mo>,</mo>
<mi>t</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle ({\boldsymbol {x}},t)}</annotation>
</semantics>
</math></span><img src="./f8cb6eb9a7f580f274a580620e0712d245bc30ac.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:5.215ex; height:2.843ex;" alt="{\displaystyle ({\boldsymbol {x}},t)}" loading="lazy"></span> as desired. Return to step 2, or else end the simulation.
</pre>
<p>where <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \nu _{j}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>ν<!-- ν --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \nu _{j}}</annotation>
</semantics>
</math></span><img src="./bcd363de082ff1daecf24211cce397b1c2b823f7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:2.058ex; height:2.343ex;" alt="{\displaystyle \nu _{j}}" loading="lazy"></span> represents adding the <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle j^{\text{th}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mi>j</mi>
<mrow class="MJX-TeXAtom-ORD">
<mtext>th</mtext>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle j^{\text{th}}}</annotation>
</semantics>
</math></span><img src="./1a8170c26debcb1b3326c93ce9527b34af28581b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.027ex; width:2.771ex; height:3.009ex;" alt="{\displaystyle j^{\text{th}}}" loading="lazy"></span> component of the given state-change vector <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \nu }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>ν<!-- ν --></mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \nu }</annotation>
</semantics>
</math></span><img src="./c15bbbb971240cf328aba572178f091684585468.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.232ex; height:1.676ex;" alt="{\displaystyle \nu }" loading="lazy"></span>. This family of algorithms is computationally expensive and thus many modifications and adaptations exist, including the next reaction method (Gibson &amp; Bruck), <a href="Tau-leaping" title="Tau-leaping">tau-leaping</a>, as well as hybrid techniques where abundant reactants are modeled with deterministic behavior. Adapted techniques generally compromise the exactitude of the theory behind the algorithm as it connects to the master equation, but offer reasonable realizations for greatly improved timescales. The computational cost of exact versions of the algorithm is determined by the coupling class of the reaction network. In weakly coupled networks, the number of reactions that is influenced by any other reaction is bounded by a small constant. In strongly coupled networks, a single reaction firing can in principle affect all other reactions. An exact version of the algorithm with constant-time scaling for weakly coupled networks has been developed, enabling efficient simulation of systems with very large numbers of reaction channels (Slepoy Thompson Plimpton 2008). The generalized Gillespie algorithm that accounts for the non-Markovian properties of random biochemical events with delay has been developed by Bratsun et al. 2005 and independently Barrio et al. 2006, as well as (Cai 2007). See the articles cited below for details.
</p><p>Partial-propensity formulations, as developed independently by both Ramaswamy et al. (2009, 2010) and Indurkhya and Beal (2010), are available to construct a family of exact versions of the algorithm whose computational cost is proportional to the number of chemical species in the network, rather than the (larger) number of reactions. These formulations can reduce the computational cost to constant-time scaling for weakly coupled networks and to scale at most linearly with the number of species for strongly coupled networks. A partial-propensity variant of the generalized Gillespie algorithm for reactions with delays has also been proposed (Ramaswamy Sbalzarini 2011). The use of partial-propensity methods is limited to elementary chemical reactions, i.e., reactions with at most two different reactants. Every non-elementary chemical reaction can be equivalently decomposed into a set of elementary ones, at the expense of a linear (in the order of the reaction) increase in network size.
</p>
<div class="mw-heading mw-heading2"><h2 id="Examples">Examples</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1251242444">
/* start https://en.wikipedia.org/ */


.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}


/* end https://en.wikipedia.org/ */
</style>
<div class="mw-heading mw-heading3"><h3 id="Reversible_binding_of_A_and_B_to_form_AB_dimers">Reversible binding of A and B to form AB dimers</h3></div>
<p>A simple example may help to explain how the Gillespie algorithm works. Consider a system of molecules of two types, <span class="texhtml">A</span> and <span class="texhtml">B</span>. In this system, <span class="texhtml">A</span> and <span class="texhtml">B</span> reversibly bind together to form <span class="texhtml">AB</span> dimers such that two reactions are possible: either A and B react reversibly to form an <span class="texhtml">AB</span> dimer, or an <span class="texhtml">AB</span> dimer dissociates into <span class="texhtml">A</span> and <span class="texhtml">B</span>. The reaction rate constant for a given single A molecule reacting with a given single <span class="texhtml">B</span> molecule is <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k_{\mathrm {D} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>k</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">D</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k_{\mathrm {D} }}</annotation>
</semantics>
</math></span><img src="./bcb452510cbf48ea9d06ac71a2cbf3ebce3b6860.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.699ex; height:2.509ex;" alt="{\displaystyle k_{\mathrm {D} }}" loading="lazy"></span>, and the reaction rate for an <span class="texhtml">AB</span> dimer breaking up is <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k_{\mathrm {B} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>k</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k_{\mathrm {B} }}</annotation>
</semantics>
</math></span><img src="./c9b90d21a1c8fb907fddab1caded3b7f1eeffe3d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.607ex; height:2.509ex;" alt="{\displaystyle k_{\mathrm {B} }}" loading="lazy"></span>.
</p><p>If at time <i>t</i> there is one molecule of each type then the rate of dimer formation is <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k_{\mathrm {D} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>k</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">D</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k_{\mathrm {D} }}</annotation>
</semantics>
</math></span><img src="./bcb452510cbf48ea9d06ac71a2cbf3ebce3b6860.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.699ex; height:2.509ex;" alt="{\displaystyle k_{\mathrm {D} }}" loading="lazy"></span>, while if there are <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n_{\mathrm {A} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">A</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n_{\mathrm {A} }}</annotation>
</semantics>
</math></span><img src="./b7ddcbc2253f3bfbe06a4b5a1ee14b9f9a3387ea.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.86ex; height:2.009ex;" alt="{\displaystyle n_{\mathrm {A} }}" loading="lazy"></span> molecules of type <span class="texhtml">A</span> and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n_{\mathrm {B} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n_{\mathrm {B} }}</annotation>
</semantics>
</math></span><img src="./73213470f88ba314651ac610eb2387ac5e11abe2.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.791ex; height:2.009ex;" alt="{\displaystyle n_{\mathrm {B} }}" loading="lazy"></span> molecules of type <span class="texhtml">B</span>, the rate of dimer formation is <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k_{\mathrm {D} }n_{\mathrm {A} }n_{\mathrm {B} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>k</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">D</mi>
</mrow>
</mrow>
</msub>
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">A</mi>
</mrow>
</mrow>
</msub>
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k_{\mathrm {D} }n_{\mathrm {A} }n_{\mathrm {B} }}</annotation>
</semantics>
</math></span><img src="./a31f0574e88b0e5313f6ba06fab5a4ccad1c05ce.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:8.349ex; height:2.509ex;" alt="{\displaystyle k_{\mathrm {D} }n_{\mathrm {A} }n_{\mathrm {B} }}" loading="lazy"></span>. If there are <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n_{\mathrm {AB} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">A</mi>
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n_{\mathrm {AB} }}</annotation>
</semantics>
</math></span><img src="./000053613a0e05191da6eb2a85b39a23690f825a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:4.023ex; height:2.009ex;" alt="{\displaystyle n_{\mathrm {AB} }}" loading="lazy"></span> dimers then the rate of dimer dissociation is <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k_{\mathrm {B} }n_{\mathrm {AB} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>k</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">A</mi>
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k_{\mathrm {B} }n_{\mathrm {AB} }}</annotation>
</semantics>
</math></span><img src="./ac49398a5ad97d8b0d996820306fdfcf6468da0f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:6.63ex; height:2.509ex;" alt="{\displaystyle k_{\mathrm {B} }n_{\mathrm {AB} }}" loading="lazy"></span>.
</p><p>The total reaction rate, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle R_{\mathrm {TOT} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>R</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">O</mi>
<mi mathvariant="normal">T</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle R_{\mathrm {TOT} }}</annotation>
</semantics>
</math></span><img src="./ba6778e56ed0bffb3b175b0702ad350e6ab849d1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:5.648ex; height:2.509ex;" alt="{\displaystyle R_{\mathrm {TOT} }}" loading="lazy"></span>, at time <i>t</i> is then given by
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle R_{\mathrm {TOT} }=k_{\mathrm {D} }n_{\mathrm {A} }n_{\mathrm {B} }+k_{\mathrm {B} }n_{\mathrm {AB} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>R</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">O</mi>
<mi mathvariant="normal">T</mi>
</mrow>
</mrow>
</msub>
<mo>=</mo>
<msub>
<mi>k</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">D</mi>
</mrow>
</mrow>
</msub>
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">A</mi>
</mrow>
</mrow>
</msub>
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>k</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">A</mi>
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle R_{\mathrm {TOT} }=k_{\mathrm {D} }n_{\mathrm {A} }n_{\mathrm {B} }+k_{\mathrm {B} }n_{\mathrm {AB} }}</annotation>
</semantics>
</math></span><img src="./57fe6d84b3626de7608fe3d09b41e4681d99e465.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:26.566ex; height:2.509ex;" alt="{\displaystyle R_{\mathrm {TOT} }=k_{\mathrm {D} }n_{\mathrm {A} }n_{\mathrm {B} }+k_{\mathrm {B} }n_{\mathrm {AB} }}" loading="lazy"></span></dd></dl>
<p>So, we have now described a simple model with two reactions. This definition is independent of the Gillespie algorithm. We will now describe how to apply the Gillespie algorithm to this system.
</p><p>In the algorithm, we advance forward in time in two steps: calculating the time to the next reaction, and determining which of the possible reactions the next reaction is. Reactions are assumed to be completely random, so if the reaction rate at a time <i>t</i> is <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle R_{\mathrm {TOT} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>R</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">O</mi>
<mi mathvariant="normal">T</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle R_{\mathrm {TOT} }}</annotation>
</semantics>
</math></span><img src="./ba6778e56ed0bffb3b175b0702ad350e6ab849d1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:5.648ex; height:2.509ex;" alt="{\displaystyle R_{\mathrm {TOT} }}" loading="lazy"></span>, then the time, δ<i>t</i>, until the next reaction occurs is a random number drawn from exponential distribution function with mean <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 1/R_{\mathrm {TOT} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>1</mn>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<msub>
<mi>R</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">O</mi>
<mi mathvariant="normal">T</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 1/R_{\mathrm {TOT} }}</annotation>
</semantics>
</math></span><img src="./dee85ff7f8c21251f6876b84b872b3bcd94d7259.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:7.973ex; height:2.843ex;" alt="{\displaystyle 1/R_{\mathrm {TOT} }}" loading="lazy"></span>. Thus, we advance time from <i>t</i> to <i>t</i> + δ<i>t</i>.
</p>

<p>The probability that this reaction is an <span class="texhtml">A</span> molecule binding to a <span class="texhtml">B</span> molecule is simply the fraction of total rate due to this type of reaction, i.e.,
</p><p>the probability that reaction is <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle P({\ce {{A}+ B -> AB}})=k_{D}n_{A}n_{B}/R_{{\ce {TOT}}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>P</mi>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mtext>A</mtext>
</mrow>
<mo>+</mo>
<mtext>B</mtext>
<mo stretchy="false">⟶<!-- ⟶ --></mo>
<mtext>AB</mtext>
</mrow>
<mo stretchy="false">)</mo>
<mo>=</mo>
<msub>
<mi>k</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>D</mi>
</mrow>
</msub>
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>A</mi>
</mrow>
</msub>
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>B</mi>
</mrow>
</msub>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<msub>
<mi>R</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mtext>TOT</mtext>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle P({\ce {{A}+ B -&gt; AB}})=k_{D}n_{A}n_{B}/R_{{\ce {TOT}}}}</annotation>
</semantics>
</math></span><img src="./2c0e742625cd6afd8f5c080ed821dffe0b8c8422.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:36.715ex; height:2.843ex;" alt="{\displaystyle P({\ce {{A}+ B -> AB}})=k_{D}n_{A}n_{B}/R_{{\ce {TOT}}}}" loading="lazy"></span>
</p><p>The probability that the next reaction is an <span class="texhtml">AB</span> dimer dissociating is just 1 minus that. So with these two probabilities we either form a dimer by reducing <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n_{\mathrm {A} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">A</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n_{\mathrm {A} }}</annotation>
</semantics>
</math></span><img src="./b7ddcbc2253f3bfbe06a4b5a1ee14b9f9a3387ea.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.86ex; height:2.009ex;" alt="{\displaystyle n_{\mathrm {A} }}" loading="lazy"></span> and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n_{\mathrm {B} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n_{\mathrm {B} }}</annotation>
</semantics>
</math></span><img src="./73213470f88ba314651ac610eb2387ac5e11abe2.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.791ex; height:2.009ex;" alt="{\displaystyle n_{\mathrm {B} }}" loading="lazy"></span> by one, and increase <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n_{\mathrm {AB} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">A</mi>
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n_{\mathrm {AB} }}</annotation>
</semantics>
</math></span><img src="./000053613a0e05191da6eb2a85b39a23690f825a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:4.023ex; height:2.009ex;" alt="{\displaystyle n_{\mathrm {AB} }}" loading="lazy"></span> by one, or we dissociate a dimer and increase <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n_{\mathrm {A} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">A</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n_{\mathrm {A} }}</annotation>
</semantics>
</math></span><img src="./b7ddcbc2253f3bfbe06a4b5a1ee14b9f9a3387ea.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.86ex; height:2.009ex;" alt="{\displaystyle n_{\mathrm {A} }}" loading="lazy"></span> and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n_{\mathrm {B} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n_{\mathrm {B} }}</annotation>
</semantics>
</math></span><img src="./73213470f88ba314651ac610eb2387ac5e11abe2.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.791ex; height:2.009ex;" alt="{\displaystyle n_{\mathrm {B} }}" loading="lazy"></span> by one and decrease <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n_{\mathrm {AB} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">A</mi>
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n_{\mathrm {AB} }}</annotation>
</semantics>
</math></span><img src="./000053613a0e05191da6eb2a85b39a23690f825a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:4.023ex; height:2.009ex;" alt="{\displaystyle n_{\mathrm {AB} }}" loading="lazy"></span> by one.
</p><p>Now we have both advanced time to <i>t</i> + δ<i>t</i>, and performed a single reaction. The Gillespie algorithm just repeats these two steps as many times as needed to simulate the system for however long we want (i.e., for as many reactions). The result of a Gillespie simulation that starts with <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n_{\mathrm {A} }=n_{\mathrm {B} }=10}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">A</mi>
</mrow>
</mrow>
</msub>
<mo>=</mo>
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
<mo>=</mo>
<mn>10</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n_{\mathrm {A} }=n_{\mathrm {B} }=10}</annotation>
</semantics>
</math></span><img src="./e9367067630e80870902383ddb20196edb8302c3.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:14.172ex; height:2.509ex;" alt="{\displaystyle n_{\mathrm {A} }=n_{\mathrm {B} }=10}" loading="lazy"></span> and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n_{\mathrm {AB} }=0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">A</mi>
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
<mo>=</mo>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n_{\mathrm {AB} }=0}</annotation>
</semantics>
</math></span><img src="./66bcdbae971a973d252cd96ba837b0e84d04df97.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:8.284ex; height:2.509ex;" alt="{\displaystyle n_{\mathrm {AB} }=0}" loading="lazy"></span> at <i>t</i>=0, and where <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k_{\mathrm {D} }=2}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>k</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">D</mi>
</mrow>
</mrow>
</msub>
<mo>=</mo>
<mn>2</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k_{\mathrm {D} }=2}</annotation>
</semantics>
</math></span><img src="./4dee8f5de806ebb43bd1f834293904bc885ba9d4.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:6.96ex; height:2.509ex;" alt="{\displaystyle k_{\mathrm {D} }=2}" loading="lazy"></span> and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k_{\mathrm {B} }=1}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>k</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
<mo>=</mo>
<mn>1</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k_{\mathrm {B} }=1}</annotation>
</semantics>
</math></span><img src="./e3ba05fbad6365c66e286da75efabbb59bd321f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:6.868ex; height:2.509ex;" alt="{\displaystyle k_{\mathrm {B} }=1}" loading="lazy"></span>, is shown at the right. For these parameter values, on average there are 8 <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n_{\mathrm {AB} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">A</mi>
<mi mathvariant="normal">B</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n_{\mathrm {AB} }}</annotation>
</semantics>
</math></span><img src="./000053613a0e05191da6eb2a85b39a23690f825a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:4.023ex; height:2.009ex;" alt="{\displaystyle n_{\mathrm {AB} }}" loading="lazy"></span> dimers and 2 of <span class="texhtml">A</span> and <span class="texhtml">B</span> but due to the small numbers of molecules fluctuations around these values are large. The Gillespie algorithm is often used to study systems where these fluctuations are important.
</p><p>That was just a simple example, with two reactions. More complex systems with more reactions are handled in the same way. All reaction rates must be calculated at each time step, and one chosen with probability equal to its fractional contribution to the rate. Time is then advanced as in this example.
</p>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFGillespie2007" class="citation journal cs1">Gillespie, Daniel T. (2007-05-01). <span class="id-lock-subscription" title="Paid subscription required"><a rel="nofollow" class="external text" href="https://www.annualreviews.org/doi/10.1146/annurev.physchem.58.032806.104637">"Stochastic Simulation of Chemical Kinetics"</a></span>. <i>Annual Review of Physical Chemistry</i>. <b>58</b> (1): <span class="nowrap">35–</span>55. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2007ARPC...58...35G">2007ARPC...58...35G</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1146%2Fannurev.physchem.58.032806.104637">10.1146/annurev.physchem.58.032806.104637</a>. <a href="ISSN_(identifier)" class="mw-redirect" title="ISSN (identifier)">ISSN</a>&nbsp;<a rel="nofollow" class="external text" href="https://search.worldcat.org/issn/0066-426X">0066-426X</a>. <a href="PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&nbsp;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/17037977">17037977</a>.</cite></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="Further_reading">Further reading</h2></div>
<ul><li><cite id="CITEREFGillespie,_Daniel_T.1977" class="citation journal cs1">Gillespie, Daniel T. (1977). "Exact Stochastic Simulation of Coupled Chemical Reactions". <i>The Journal of Physical Chemistry</i>. <b>81</b> (25): <span class="nowrap">2340–</span>2361. <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a>&nbsp;<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.704.7634">10.1.1.704.7634</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1021%2Fj100540a008">10.1021/j100540a008</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:2606191">2606191</a>.</cite></li>
<li><cite id="CITEREFGillespie,_Daniel_T.1976" class="citation journal cs1">Gillespie, Daniel T. (1976). "A General Method for Numerically Simulating the Stochastic Time Evolution of Coupled Chemical Reactions". <i>Journal of Computational Physics</i>. <b>22</b> (4): <span class="nowrap">403–</span>434. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/1976JCoPh..22..403G">1976JCoPh..22..403G</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0021-9991%2876%2990041-3">10.1016/0021-9991(76)90041-3</a>.</cite></li>
<li><cite id="CITEREFGibson,_Michael_A.Bruck,_Jehoshua2000" class="citation journal cs1">Gibson, Michael A.; Bruck, Jehoshua (2000). <a rel="nofollow" class="external text" href="http://www.soe.ucsc.edu/~msmangel/Gibson%20and%20Bruck%202000.pdf">"Efficient Exact Stochastic Simulation of Chemical Systems with Many Species and Many Channels"</a> <span class="cs1-format">(PDF)</span>. <i>Journal of Physical Chemistry A</i>. <b>104</b> (9): <span class="nowrap">1876–</span>1889. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2000JPCA..104.1876G">2000JPCA..104.1876G</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1021%2Fjp993732q">10.1021/jp993732q</a>.</cite></li>
<li><cite id="CITEREFDoob,_Jacob_L.1942" class="citation journal cs1">Doob, Jacob L. (1942). <a rel="nofollow" class="external text" href="https://doi.org/10.1090%2FS0002-9947-1942-0006633-7">"Topics in the Theory of Markoff Chains"</a>. <i>Transactions of the American Mathematical Society</i>. <b>52</b> (1): <span class="nowrap">37–</span>64. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1090%2FS0002-9947-1942-0006633-7">10.1090/S0002-9947-1942-0006633-7</a></span>. <a href="JSTOR_(identifier)" class="mw-redirect" title="JSTOR (identifier)">JSTOR</a>&nbsp;<a rel="nofollow" class="external text" href="https://www.jstor.org/stable/1990152">1990152</a>.</cite></li>
<li><cite id="CITEREFDoob,_Jacob_L.1945" class="citation journal cs1">Doob, Jacob L. (1945). "Markoff chains – Denumerable case". <i>Transactions of the American Mathematical Society</i>. <b>58</b> (3): <span class="nowrap">455–</span>473. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.2307%2F1990339">10.2307/1990339</a>. <a href="JSTOR_(identifier)" class="mw-redirect" title="JSTOR (identifier)">JSTOR</a>&nbsp;<a rel="nofollow" class="external text" href="https://www.jstor.org/stable/1990339">1990339</a>.</cite></li>
<li><cite id="CITEREFPressTeukolskyVetterlingFlannery2007" class="citation book cs1">Press, William H.; Teukolsky, Saul A.; Vetterling, William T.; Flannery, Brian P. (2007). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20110811154417/http://apps.nrbook.com/empanel/index.html#pg=946">"Section 17.7. Stochastic Simulation of Chemical Reaction Networks"</a>. <i>Numerical Recipes: The Art of Scientific Computing</i> (3rd&nbsp;ed.). New York, NY: Cambridge University Press. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-521-88068-8</bdi>. Archived from <a rel="nofollow" class="external text" href="http://apps.nrbook.com/empanel/index.html#pg=946">the original</a> on 2011-08-11<span class="reference-accessdate">. Retrieved <span class="nowrap">2011-08-17</span></span>.</cite></li>
<li><cite id="CITEREFKolmogorov,_Andrey_N.1931" class="citation journal cs1">Kolmogorov, Andrey N. (1931). "Über die analytischen Methoden in der Wahrscheinlichkeitsrechnung" [On Analytical Methods in the Theory of Probability]. <i>Mathematische Annalen</i>. <b>104</b>: <span class="nowrap">415–</span>458. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2FBF01457949">10.1007/BF01457949</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:119439925">119439925</a>.</cite></li>
<li><cite id="CITEREFFeller,_Willy1940" class="citation journal cs1">Feller, Willy (1940). <a rel="nofollow" class="external text" href="https://doi.org/10.2307%2F1990095">"On the Integro-Differential Equations of Purely Discontinuous Markoff Processes"</a>. <i>Transactions of the American Mathematical Society</i>. <b>48</b> (3): <span class="nowrap">4885–</span>15. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.2307%2F1990095">10.2307/1990095</a></span>. <a href="JSTOR_(identifier)" class="mw-redirect" title="JSTOR (identifier)">JSTOR</a>&nbsp;<a rel="nofollow" class="external text" href="https://www.jstor.org/stable/1970064">1970064</a>.</cite></li>
<li><cite id="CITEREFKendall,_David_G.1950" class="citation journal cs1">Kendall, David G. (1950). "An Artificial Realization of a Simple "Birth-and-Death" Process". <i>Journal of the Royal Statistical Society, Series B</i>. <b>12</b> (1): <span class="nowrap">116–</span>119. <a href="JSTOR_(identifier)" class="mw-redirect" title="JSTOR (identifier)">JSTOR</a>&nbsp;<a rel="nofollow" class="external text" href="https://www.jstor.org/stable/2983837">2983837</a>.</cite></li>
<li><cite id="CITEREFBartlett,_Maurice_S.1953" class="citation journal cs1">Bartlett, Maurice S. (1953). "Stochastic Processes or the Statistics of Change". <i>Journal of the Royal Statistical Society, Series C</i>. <b>2</b> (1): <span class="nowrap">44–</span>64. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.2307%2F2985327">10.2307/2985327</a>. <a href="JSTOR_(identifier)" class="mw-redirect" title="JSTOR (identifier)">JSTOR</a>&nbsp;<a rel="nofollow" class="external text" href="https://www.jstor.org/stable/2985327">2985327</a>.</cite></li>
<li><cite id="CITEREFRathinam,_MuruhanPetzold,_Linda_R.Cao,_YangGillespie,_Daniel_T.2003" class="citation journal cs1">Rathinam, Muruhan; <a href="Linda_Petzold" title="Linda Petzold">Petzold, Linda R.</a>; Cao, Yang; Gillespie, Daniel T. (2003). "Stiffness in stochastic chemically reacting systems: The implicit tau-leaping method". <i>Journal of Chemical Physics</i>. <b>119</b> (24): <span class="nowrap">12784–</span>12794. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2003JChPh.11912784R">2003JChPh.11912784R</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1063%2F1.1627296">10.1063/1.1627296</a>.</cite></li>
<li><cite id="CITEREFSinitsynHengartnerNemenman2009" class="citation journal cs1">Sinitsyn, Nikolai A.; Hengartner, Nicolas; Nemenman, Ilya (2009). <a rel="nofollow" class="external text" href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2705573">"Adiabatic coarse-graining and simulations of stochastic biochemical networks"</a>. <i>Proceedings of the National Academy of Sciences of the United States of America</i>. <b>106</b> (20): <span class="nowrap">10546–</span>10551. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2009PNAS..10610546S">2009PNAS..10610546S</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1073%2Fpnas.0809340106">10.1073/pnas.0809340106</a></span>. <a href="PMC_(identifier)" class="mw-redirect" title="PMC (identifier)">PMC</a>&nbsp;<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2705573">2705573</a></span>. <a href="PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&nbsp;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/19525397">19525397</a>.</cite></li>
<li><cite id="CITEREFSalisKaznessis2005" class="citation journal cs1">Salis, Howard; Kaznessis, Yiannis N. (2005). "Accurate hybrid stochastic simulation of a system of coupled chemical or biochemical reactions". <i>Journal of Chemical Physics</i>. <b>122</b> (5): 054103. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2005JChPh.122e4103S">2005JChPh.122e4103S</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1063%2F1.1835951">10.1063/1.1835951</a>. <a href="PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&nbsp;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/15740306">15740306</a>.</cite></li>
<li>(Slepoy Thompson Plimpton 2008): <cite id="CITEREFSlepoyThompsonPlimpton2008" class="citation journal cs1">Slepoy, Alexander; Thompson, Aidan P.; Plimpton, Steven J. (2008). "A constant-time kinetic Monte Carlo algorithm for simulation of large biochemical reaction networks". <i>Journal of Chemical Physics</i>. <b>128</b> (20): 205101. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2008JChPh.128t5101S">2008JChPh.128t5101S</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1063%2F1.2919546">10.1063/1.2919546</a>. <a href="PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&nbsp;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/18513044">18513044</a>.</cite></li>
<li>(Bratsun et al. 2005): <cite id="CITEREFBratsun,_DmitriVolfson,_DmitriHasty,_JeffTsimring,_Lev_S.2005" class="citation journal cs1">Bratsun, Dmitri; Volfson, Dmitri; Hasty, Jeff; Tsimring, Lev S. (2005). <a rel="nofollow" class="external text" href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1253555">"Delay-induced stochastic oscillations in gene regulation"</a>. <i>Proceedings of the National Academy of Sciences of the United States of America</i>. <b>102</b> (41): <span class="nowrap">14593–</span>8. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2005PNAS..10214593B">2005PNAS..10214593B</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1073%2Fpnas.0503858102">10.1073/pnas.0503858102</a></span>. <a href="PMC_(identifier)" class="mw-redirect" title="PMC (identifier)">PMC</a>&nbsp;<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1253555">1253555</a></span>. <a href="PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&nbsp;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/16199522">16199522</a>.</cite></li>
<li>(Barrio et al. 2006): <cite id="CITEREFBarrio,_ManuelBurrage,_KevinLeier,_AndréTian,_Tianhai2006" class="citation journal cs1">Barrio, Manuel; Burrage, Kevin; Leier, André; Tian, Tianhai (2006). <a rel="nofollow" class="external text" href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1560403">"Oscillatory Regulation of <i>hes1</i>: Discrete Stochastic Delay Modelling and Simulation"</a>. <i>PLOS Computational Biology</i>. <b>2</b> (9): 1017. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2006PLSCB...2..117B">2006PLSCB...2..117B</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1371%2Fjournal.pcbi.0020117">10.1371/journal.pcbi.0020117</a></span>. <a href="PMC_(identifier)" class="mw-redirect" title="PMC (identifier)">PMC</a>&nbsp;<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1560403">1560403</a></span>. <a href="PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&nbsp;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/16965175">16965175</a>.</cite></li>
<li>(Cai 2007): <cite id="CITEREFCai,_Xiaodong2007" class="citation journal cs1">Cai, Xiaodong (2007). "Exact stochastic simulation of coupled chemical reactions with delays". <i>Journal of Chemical Physics</i>. <b>126</b> (12): 124108. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2007JChPh.126l4108C">2007JChPh.126l4108C</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1063%2F1.2710253">10.1063/1.2710253</a>. <a href="PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&nbsp;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/17411109">17411109</a>.</cite></li>
<li>(Barnes Chu 2010): <cite id="CITEREFBarnes,_David_J.Chu,_Dominique2010" class="citation book cs1">Barnes, David J.; Chu, Dominique (2010). <i>Introduction to Modeling for Biosciences</i>. Springer Verlag. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2010itmf.book.....B">2010itmf.book.....B</a>.</cite></li>
<li>(Ramaswamy González-Segredo Sbalzarini 2009): <cite id="CITEREFRamaswamy,_RajeshGonzález-Segredo,_NélidoSbalzarini,_Ivo_F.2009" class="citation journal cs1">Ramaswamy, Rajesh; González-Segredo, Nélido; Sbalzarini, Ivo F. (2009). "A new class of highly efficient exact stochastic simulation algorithms for chemical reaction networks". <i>Journal of Chemical Physics</i>. <b>130</b> (24): 244104. <a href="ArXiv_(identifier)" class="mw-redirect" title="ArXiv (identifier)">arXiv</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://arxiv.org/abs/0906.1992">0906.1992</a></span>. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2009JChPh.130x4104R">2009JChPh.130x4104R</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1063%2F1.3154624">10.1063/1.3154624</a>. <a href="PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&nbsp;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/19566139">19566139</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:4952205">4952205</a>.</cite></li>
<li>(Ramaswamy Sbalzarini 2010): <cite id="CITEREFRamaswamy,_RajeshSbalzarini,_Ivo_F.2010" class="citation journal cs1">Ramaswamy, Rajesh; Sbalzarini, Ivo F. (2010). <a rel="nofollow" class="external text" href="https://www.zora.uzh.ch/id/eprint/39866/1/PSSACR.pdf">"A partial-propensity variant of the composition-rejection stochastic simulation algorithm for chemical reaction networks"</a> <span class="cs1-format">(PDF)</span>. <i>Journal of Chemical Physics</i>. <b>132</b> (4): 044102. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2010JChPh.132d4102R">2010JChPh.132d4102R</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1063%2F1.3297948">10.1063/1.3297948</a>. <a href="PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&nbsp;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/20113014">20113014</a>.</cite></li>
<li>(Indurkhya Beal 2010): <cite id="CITEREFIndurkhya,_SagarBeal,_Jacob_S.2005" class="citation journal cs1">Indurkhya, Sagar; Beal, Jacob S. (2005). Isalan, Mark (ed.). <a rel="nofollow" class="external text" href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2798956">"Reaction Factoring and Bipartite Update Graphs Accelerate the Gillespie Algorithm for Large-Scale Biochemical Systems"</a>. <i>PLOS ONE</i>. <b>5</b> (1): e8125. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2010PLoSO...5.8125I">2010PLoSO...5.8125I</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1371%2Fjournal.pone.0008125">10.1371/journal.pone.0008125</a></span>. <a href="PMC_(identifier)" class="mw-redirect" title="PMC (identifier)">PMC</a>&nbsp;<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2798956">2798956</a></span>. <a href="PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&nbsp;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/20066048">20066048</a>.</cite></li>
<li>(Ramaswamy Sbalzarini 2011): <cite id="CITEREFRamaswamy,_RajeshSbalzarini,_Ivo_F.2011" class="citation journal cs1">Ramaswamy, Rajesh; Sbalzarini, Ivo F. (2011). <a rel="nofollow" class="external text" href="https://www.zora.uzh.ch/id/eprint/79206/1/pub8.pdf">"A partial-propensity formulation of the stochastic simulation algorithm for chemical reaction networks with delays"</a> <span class="cs1-format">(PDF)</span>. <i>Journal of Chemical Physics</i>. <b>134</b> (1): 014106. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2011JChPh.134a4106R">2011JChPh.134a4106R</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1063%2F1.3521496">10.1063/1.3521496</a>. <a href="PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&nbsp;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/21218996">21218996</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:4949530">4949530</a>.</cite></li>
<li>(Yates Klingbeil 2013): <cite id="CITEREFYates,_Christian_A.Klingbeil,_Guido2013" class="citation journal cs1">Yates, Christian A.; Klingbeil, Guido (2013). <a rel="nofollow" class="external text" href="https://ora.ox.ac.uk/objects/uuid:502bcf01-26b2-47ad-9427-e7e5c1d0c604">"Recycling random numbers in the stochastic simulation algorithm"</a>. <i>Annual Review of Physical Chemistry</i>. <b>58</b> (9): 094103. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2013JChPh.138i4103Y">2013JChPh.138i4103Y</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1063%2F1.4792207">10.1063/1.4792207</a>. <a href="PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&nbsp;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/23485273">23485273</a>.</cite></li>
<li><cite id="CITEREFGillespie,_Daniel_T.2007" class="citation journal cs1">Gillespie, Daniel T. (2007). "Stochastic Simulation of Chemical Kinetics". <i>Annual Review of Physical Chemistry</i>. <b>58</b>: <span class="nowrap">35–</span>55. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2007ARPC...58...35G">2007ARPC...58...35G</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1146%2Fannurev.physchem.58.032806.104637">10.1146/annurev.physchem.58.032806.104637</a>. <a href="PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&nbsp;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/17037977">17037977</a>.</cite></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-06-23" href="https://en.wikipedia.org/wiki/?title=Gillespie_algorithm&amp;oldid=1297058383">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>